﻿<Window x:Class="eStock.ChildWindows.WndSettings"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:CustomControls="clr-namespace:eStock.Controls.CustomControls"
        xmlns:local="clr-namespace:eStock.ChildWindows" Title="WndSettings" Height="400" Width="600" Background="#F0F0F0" ShowInTaskbar="False" ResizeMode="NoResize" Icon="/eStock;component/Images/setting_tools.png">
    <Window.Resources>
        <local:NegateConverter x:Key="negate" />
    </Window.Resources>
    
    <Grid Margin="10" >
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="auto" />
        </Grid.RowDefinitions>
        <TabControl Grid.Row="0" Background="White" Margin="0">
            <TabItem Header="Allgemein">
                <StackPanel Margin="15">
                    <CustomControls:UICustomLabel Header="Datenbank beim beenden aktualisieren:" HeaderWidth="300" Margin="0,0,0,5">
                        <CustomControls:UICustomLabel.Child>
                            <CheckBox Name="chkUpdateOnClose" VerticalAlignment="Bottom" IsChecked="true" />
                        </CustomControls:UICustomLabel.Child>
                    </CustomControls:UICustomLabel>
                </StackPanel>
            </TabItem>
            <TabItem Header="Datenbank">
                <StackPanel Margin="15,15,15,10">
                    <CheckBox Name="chkLocalDatabase" Content="Lokale Datenbank verwenden" Margin="0,0,0,30" IsChecked="true"/>
                    <StackPanel IsEnabled="{Binding IsChecked, ElementName=chkLocalDatabase, Converter={StaticResource negate}}">
                        <CustomControls:UILabel Header="Hostadresse:" x:Name="txtdbHost" HeaderWidth="100" Margin="0,0,0,5"/>
                        <CustomControls:UILabel Header="Port:" x:Name="txtdbPort" HeaderWidth="100" Margin="0,0,0,5"/>
                        <CustomControls:UILabel Header="Benutzername:" x:Name="txtdbUser" HeaderWidth="100" Margin="0,0,0,5"/>
                        <CustomControls:UICustomLabel Header="Passwort:" IsTabStop="False" HeaderWidth="100" Margin="0,0,0,5" >
                            <CustomControls:UICustomLabel.Child>
                                <PasswordBox Name="txtdbPass" />
                            </CustomControls:UICustomLabel.Child>
                        </CustomControls:UICustomLabel>
                        <CustomControls:UILabel Header="Datenbank:" IsTabStop="False" x:Name="txtdbDatabase" HeaderWidth="100" Margin="0,0,0,5"/>
                        <StackPanel Margin="0,15,0,0" Orientation="Horizontal">
                            <Button Content="Testen" Width="120" HorizontalAlignment="Left" Name="btnTestDBSettings" Click="BtnTestDBSettingsClick" />
                            <Image Name="imgStatus" Margin="5,0,0,0" Width="25"/>
                        </StackPanel>
                    </StackPanel>
                </StackPanel>
            </TabItem>
        </TabControl>
        <StackPanel Grid.Row="1" HorizontalAlignment="Right" Orientation="Horizontal" Margin="0,10,0,0">
            <Button Content="OK" Width="90" Margin="4,0,0,0" Name="btnOK" Click="BtnOkClick" />
            <Button Content="Abbrechen" Width="90" Margin="4,0,0,0" Name="btnAbbort" Click="BtnAbbortClick" />
            <Button Content="Hilfe" Width="90" Margin="4,0,0,0" Name="btnHelp"/>
        </StackPanel>
    </Grid>
</Window>
